package sample;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;

import java.io.IOException;

public class SecondPane {

    @FXML
    private AnchorPane rootPane;

    @FXML
    private Button button;

    public void switch_view(ActionEvent actionEvent) throws IOException {
        AnchorPane other = FXMLLoader.load(getClass().getResource("sample.fxml"));
        ((Button)actionEvent.getSource()).getScene().setRoot(other);
    }
}
